import axios from '@/util/axios';
import config from '@/config';

export const addCustomer = async params => {
  const data = {
    ...params,
    module: 'OrderService.addCustomer',
  };
  const resp = await axios.request({
    url: config.postUrl,
    data,
    method: 'post',
  });
  return resp;
};

export const getCartype = async () => {
  const resp = await axios.request({
    url: config.apiUrl,
    params: {
      module: 'OrderService.cartype',
    },
    method: 'get',
  });
  return resp;
};

export const getCarShows = async () => {
  const resp = await axios.request({
    url: config.apiUrl,
    params: {
      module: 'OrderService.getCarShows',
    },
    method: 'get',
  });
  return resp;
};

export const getCarShowInfo = async payload => {
  const resp = await axios.request({
    url: config.apiUrl,
    params: {
      module: 'OrderService.getCarShowInfo',
      ...payload,
    },
    method: 'get',
  });
  return resp;
};

export const getCompany = async () => {
  const resp = await axios.request({
    url: config.apiUrl,
    params: {
      module: 'OrderService.company',
    },
    method: 'get',
  });
  return resp;
};
